<template>
  <!-- 医院住院病人费用统计报表 -->
  <div>
    <h1>医 院 住 院 病 人 费 用 统 计 报 表</h1>
    <h3>时期：{{startDate}} ~ {{endDate}}</h3>
    <h2>医院名称：湖北省中医院</h2>
    <el-table :data="tableData" stripe border style="width: 100%">
      <el-table-column prop="bqmc" label="病区" align="center" width></el-table-column>
      <el-table-column label="出院人数" align="center" width>
        <el-table-column prop="f1" label="总计" align="center" width></el-table-column>
        <el-table-column label="其中：出院病人数" align="center" width>
          <el-table-column prop="f2" label="合计" align="center" width></el-table-column>
          <el-table-column prop="f3" label="治愈" align="center" width></el-table-column>
          <el-table-column prop="f4" label="好转" align="center" width></el-table-column>
          <el-table-column prop="f5" label="未愈" align="center" width></el-table-column>
          <el-table-column prop="f6" label="死亡" align="center" width></el-table-column>
        </el-table-column>
      </el-table-column>
      <el-table-column label="出院者年龄分组" align="center" width>
        <el-table-column prop="f7" label="0-" align="center" width></el-table-column>
        <el-table-column prop="f8" label="1-" align="center" width></el-table-column>
        <el-table-column prop="f9" label="15-" align="center" width></el-table-column>
        <el-table-column prop="f10" label="45-" align="center" width></el-table-column>
        <el-table-column prop="f11" label="65-" align="center" width></el-table-column>
        <el-table-column prop="f12" label="75-" align="center" width></el-table-column>
      </el-table-column>
      <el-table-column prop="f13" label="出院者占用总床日数" align="center" width></el-table-column>
      <el-table-column prop="f14" label="出院者平均住院日" align="center" width></el-table-column>
      <el-table-column label="出院者费用（元）" align="center" width>
        <el-table-column prop="f15" label="合计" align="center" width></el-table-column>
        <el-table-column prop="f16" label="住院费" align="center" width></el-table-column>
        <el-table-column prop="f17" label="中药费" align="center" width></el-table-column>
        <el-table-column prop="f18" label="西药费" align="center" width></el-table-column>
        <el-table-column prop="f19" label="诊疗费" align="center" width></el-table-column>
        <el-table-column prop="f20" label="手术费" align="center" width></el-table-column>
        <el-table-column prop="f21" label="检查费" align="center" width></el-table-column>
        <el-table-column prop="f22" label="化验费" align="center" width></el-table-column>
        <el-table-column prop="f23" label="放射费" align="center" width></el-table-column>
        <el-table-column prop="f24" label="输血输氧" align="center" width></el-table-column>
        <el-table-column prop="f25" label="其它费" align="center" width></el-table-column>
      </el-table-column>
      <el-table-column prop="f26" label="出院者平均费用（元）" align="center" width></el-table-column>
      <el-table-column prop="f27" label="药品费构成比(%)" align="center" width></el-table-column>
    </el-table>
  </div>
</template>

<script>
import { patientCostStatistics } from "@/api";
import { showOkMsg, showErrorMsg } from "@/utils/index.js";

export default {
  data() {
    return {
      tableData: [],
      startDate: "",
      endDate: ""
    };
  },
  created() {
    this.getTableList();
  },
  props: ["dateList"],
  methods: {
    getTableList() {
      if (this.dateList.dateBegin && this.dateList.dateEnd) {
        patientCostStatistics({
          bz: Number(this.dateList.output),
          startTime: this.dateList.dateBegin,
          endTime: this.dateList.dateEnd
        }).then(res => {
          if (res.code === 0) {
            this.startDate = this.dateList.dateBegin;
            this.endDate = this.dateList.dateEnd;
            this.tableData = res.data;
            showOkMsg(res.msg);
          }
        });
      } else {
        showErrorMsg("请选择开始或结束日期");
      }
    }
  }
};
</script>

<style scoped>
h1 {
  font-size: 24px;
  text-align: center;
  padding: 23px 0;
}
h3 {
  text-align: center;
  padding-bottom: 20px;
}
h2 {
  padding: 4px 0;
  display: flex;
  justify-content: space-between;
}
</style>